package com.xyy.ec.pop.erp.hx.utils.hx;

import lombok.Data;

/**
 * 海翔自定义响应结构
 */
@Data
public class SeaFlyResult<T> {
    // 响应业务状态
    private Integer status;

    // 响应消息
    private String msg;

    // 响应中的数据
    private T data;



    public static SeaFlyResult ok() {
        return new SeaFlyResult(null);
    }

    public SeaFlyResult() {

    }

    public static SeaFlyResult build(Integer status, String msg) {
        return new SeaFlyResult(status, msg, null);
    }

    public SeaFlyResult(Integer status, String msg, T data) {
        this.status = status;
        this.msg = msg;
        this.data = data;
    }

    public SeaFlyResult(T data) {
        this.status = 200;
        this.msg = "OK";
        this.data = data;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
